import request from '@/utils/request'

//获取角色列表
export function getRoleList(params) {
	return request({
		method: 'get',
		url: 'tbSysRole/queryPageList',
		headers: { userButton: '43f0e6a6cf5c49ecacc771c09046a8f7' },
		params
	})
}

//添加角色
export function addedRole(data) {
	return request({
		method: 'post',
		url: 'tbSysRole/add',
		headers: { userButton: '5c65394400a04739a6f5642a9ca1abcf' },
		data
	})
}

//修改角色
export function updateRole(data) {
	return request({
		method: 'post',
		url: 'tbSysRole/update',
		headers: { userButton: '27aa989fda2c4e278d1727bd14c34b3f' },
		data
	})
}

//删除角色
export function deleteRole(id) {
	return request({
		method: 'get',
		url: 'tbSysRole/delete/' + id,
		headers: { userButton: '787b0be6450b4a3ead3714b4c1e8b094' }
	})
}

//角色详情
export function roleDetail(id) {
	return request({
		method: 'get',
		url: 'tbSysRole/query/' + id,
		headers: { userButton: '208ac2a15e9a4471bfd0c3ea5ecfe091' }
	})
}

//获取用户通过角色ID
export function getUserByRole(id) {
	return request({
		method: 'get',
		url: 'tbSysUserRole/queryByRoleId/' + id,
		headers: { userButton: '7d692e924db5441b8bba20aed83ef604' }
	})
}

//更新角色用户
export function updateRoleUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUserRole/addForRole',
		headers: { userButton: 'b70d5278616d484ea7f5d6324013dce0' },
		data
	})
}

//通过角色ID获取授权菜单
export function getMenuByRole(id) {
	return request({
		method: 'get',
		url: 'tbSysMenu/tree/' + id,
		headers: { userButton: 'ab818ba1ff3345df9e5db030761bb877' }
	})
}

//更新角色授权菜单
export function updateRoleMenu(data) {
	return request({
		method: 'post',
		url: 'tbSysRoleMenu/addBatch',
		headers: { userButton: '7a72cf1464b345499198ea65dc951921' },
		data
	})
}